package com.xt.website.util;
/*
 * @Author 爱尚实训赵国鑫
 * @ClassName  Result
 * @Date 2019/8/21/10:47
 * @Description TODO:(处理返回Jsonp或Json结果)
 */

import com.alibaba.fastjson.JSON;

public class Result {

    public static String result(Object object,String callback){

        String result = JSON.toJSONString(object);
        if(callback!=null){
            return "callback="+callback+"("+result+")";
        }else {
            return result;
        }
    }
}
